package com.kfc.service;

import com.kfc.dao.TeacherDao;
import com.kfc.entity.Teacher;
import lombok.Data;

@Data
public class TeacherServiceImpl implements TeacherService{
    // 厨师要加工食材，首先得到有食材，由采购员提供，就是要依赖采购员
    private TeacherDao teacherDao;  // 接口


    @Override
    public Teacher getOneTeacherById(int id) {
        // 从采购员那里得到食材
        Teacher teacher = teacherDao.selectOneById(id);
        // 加工食材
//        teacher.setTeacherName("王老五");
//        if (teacher==null){
//            teacher= new Teacher(10086, "佚名");
//        }
        return teacher; // 返回菜品
    }

    @Override
    public Boolean deleteById(int id) {
        int i = teacherDao.deleteTeacherById(id);
        return i>0;
    }
}
